package com.example.gx.myapplication;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {

    private Button btnGoToLoc;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        btnGoToLoc = (Button) findViewById(R.id.btnGotoLoc);
        btnGoToLoc.setOnClickListener(btnGotoLocLsn);
    }
    Button.OnClickListener btnGotoLocLsn = new Button.OnClickListener(){
        @Override
        public void onClick(View v){
            Intent intent = new Intent();
            intent.setClass(MainActivity.this,LocActivity.class);
            MainActivity.this.startActivity(intent);
        }
    };
}
